<template>
  <div>
    <el-row>
      <el-col>
        <div id="area" :style="{width: '100%', height: '400px'}"></div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  export default {
    data() {
      return {

      }
    },
    mounted() {
      this.drawLine();
    },
    methods: {
      drawLine() {
        // 基于准备好的dom，初始化echarts实例
        let area = this.$echarts.init(document.getElementById('area'));
        // 绘制图表
        area.setOption(
          {
            title: {
              text: ''
            },
            tooltip : {
              trigger: 'axis',
              axisPointer: {
                type: 'cross',
                label: {
                  backgroundColor: '#6a7985'
                }
              }
            },
            legend: {
              data:['Serie A','Serie B']
            },
            toolbox: {
              feature: {
                saveAsImage: {}
              }
            },
            grid: {
              left: '3%',
              right: '4%',
              bottom: '3%',
              containLabel: true
            },
            xAxis : [
              {
                type : 'category',
                boundaryGap : false,
                data : ['周一','周二','周三','周四','周五','周六','周日']
              }
            ],
            yAxis : [
              {
                type : 'value'
              }
            ],
            series : [
              {
                name:'Serie A',
                type:'line',
                stack: '总量',
                areaStyle: {normal: {}},
                data:[120, 132, 101, 134, 90, 230, 210]
              },
              {
                name:'Serie B',
                type:'line',
                stack: '总量',
                areaStyle: {normal: {}},
                data:[820, 932, 901, 934, 1290, 1330, 1320]
              }
            ]
          }
        );
      }
    }
  }
</script>

<style scoped>

</style>
